<!DOCTYPE html>
<html lang="en">

<head>
    <!-- META SECTION -->
    <title><%= current_site.the_title %></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <!-- END META SECTION -->

    <%= stylesheet_link_tag theme_asset_path("css/main") %>
    <%= javascript_include_tag theme_asset_path("js/main.js") %>
    <%= raw the_head %>
</head>

<body>

    <!-- container -->
    <div class="container">
        <!-- header -->
        <div class="navbar navbar-primary">
            <div class="navbar-header">
                <a id="logo" class="navbar-brand" href="<%= current_site.the_url %>"><%= image_tag current_site.the_logo, class: "img-responsive" %></a>
                <button data-target="#navbar-main" data-toggle="collapse" type="button" class="navbar-toggle">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
            <div id="navbar-main" class="navbar-collapse collapse">
                <%= raw get_nav_menu('main_menu', 'nav navbar-nav ') %>

                <ul class="nav navbar-nav navbar-right">
                    <% if signin?  %>
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#"><img src="<%= cama_current_user.decorate.the_avatar %>" style="max-width: 24px; border-radius: 50%" alt="" /> <%= cama_current_user.username %></a>
                        <ul class="dropdown-menu">
                            <li><a href="<%= cama_admin_dashboard_path %>"><%= I18n.t('camaleon_cms.common.dashboard') %></a></li>
                            <li><a href="<%= cama_admin_profile_path %>"><%= I18n.t('camaleon_cms.common.profile') %></a></li>
                            <li><a href="<%= cama_admin_logout_path %>"><%= I18n.t('camaleon_cms.common.logout') %></a></li>
                        </ul>
                    </li>
                    <% else %>
                    <li class="dropdown">
                        <a id="login-user" class="dropdown-toggle" data-toggle="dropdown" href="#"><%= I18n.t('camaleon_cms.common.login') %> / <%= I18n.t('camaleon_cms.common.register') %></a>
                        <ul class="dropdown-menu">
                            <li><a href="<%= cama_admin_login_path %>"><%= I18n.t('camaleon_cms.common.login') %></a></li>
                            <li><a href="<%= cama_admin_register_path %>"><%= I18n.t('camaleon_cms.common.register') %></a></li>
                        </ul>
                    </li>
                    <% end %>
                </ul>
                <%= raw current_site.draw_languages("language list-inline pull-right", true) %>
            </div>
        </div>
        <!-- ./header -->

        <div class="content">
            <%= yield %>
        </div>

        <!-- footer -->
        <footer>

        </footer>
        <!-- ./footer -->
    </div>
    <!-- ./container -->
</body>

</html>